package org

import org.apache.flink.streaming.api.scala._

/**
 * description ：flink app
 * author      ：剧情再美终是戏
 * mail        : 13286520398@163.com
 * date        ：Created in 2020/2/21 13:57
 * modified By ：
 * version:    : 1.0
 */
trait FlinkStreamApp {

  def doSomeThing(environment: StreamExecutionEnvironment)

  def main(args: Array[String]): Unit = {

    // 创建 flink 运行环境
    val environment = StreamExecutionEnvironment.getExecutionEnvironment

    // 设置全局并行度为1
    environment.setParallelism(1)

    // 操作
    doSomeThing(environment)

    // 执行
    environment.execute()
  }
}
